package com.example.questionnaires.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@TableName("user")
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String username;
    private String password;
    private String email;
    private String phone;
    private Integer role;  // 1:管理员 2:普通用户
    private Integer status; // 0:禁用 1:正常
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    
    public boolean getIsAdmin() {
        return role != null && role == 1;
    }
} 